package response

import (
	"fmt"
	"time"
)

type JsonTime time.Time

func (j JsonTime) MarshalJSON() ([]byte, error) {
	var stmp = fmt.Sprintf("\"%s\"", time.Time(j).Format("2006-01-02"))
	return []byte(stmp), nil
}

type GoodsResponse struct {
	ID              int32            `json:"id"`
	Category        CategoryResponse `json:"category"`
	Brands          BrandResponse    `json:"brands"`
	OnSale          bool             `json:"on_sale"`
	ShipFree        bool             `json:"ship_free"`
	IsNew           bool             `json:"is_new"`
	IsHot           bool             `json:"is_hot"`
	Name            string           `json:"name"`
	GoodsBrief      string           `json:"goods_brief"`
	GoodsSn         string           `json:"goods_sn"`
	Images          []string         `json:"images"`
	DescImages      []string         `json:"desc_images"`
	GoodsFrontImage string           `json:"goods_front_image"`
	ClickNum        int32            `json:"click_num"`
	SoldNum         int32            `json:"sold_num"`
	FavNum          int32            `json:"fav_num"`
	Stocks          int32            `json:"stocks"`
	MarketPrice     float32          `json:"market_price"`
	ShopPrice       float32          `json:"shop_price"`
}
